1. Field of the Invention
The present invention relates to scanners in which the integration period is not an integer multiple of the step period. In particular, the invention relates to timing a resume after a pause for scanners in which the integration period is not an integer multiple of the step period.
2. Description of the Related Art
Scanners generate data at a rate proportional to a processor clock signal. The duration of a scan is thus the amount of data to scan divided by the rate. The amount of data to scan is determined by the horizontal resolution, the horizontal size, the vertical resolution, and the vertical size. Scanners transfer the scanned data to an associated device (usually a computer) at a rate generally less than the processor clock speed. Thus, data accumulates at the scanner faster than it can be transferred. Many scanners include a buffer to hold the accumulated data.
Unfortunately, the accumulated data backlog is often greater than a desired size for the buffer. Such desired size is usually measured by cost, with a large enough buffer to hold the largest possible data accumulation being expensive and usually inefficient because often the largest possible data backlog will not be generated. A typical solution, instead, is to provide a moderately-sized buffer and then pause generation of the scanned data until the buffer has been emptied.
The amount of time the scanner takes to process one line of an image is called the integration period. An xe2x80x9cintegration signalxe2x80x9d is a series of pulses spaced apart from one another by the integration period. A horizontal sensor in the scanner reads one line of the image. Data processing hardware in the scanner uses the integration signal to time its processing of the data from the sensor.
A stepper motor moves the sensor vertically down the image. (Some scanners move the image instead of the sensor, and some scanners move a vertical sensor horizontally, but the principles are the same.) A xe2x80x9cstepxe2x80x9d is a unit of vertical movement. (Some scanners move the sensor in units of microsteps, but the principles are the same.) The amount of time the scanner takes to move one step is called the step period. A series of pulses spaced apart from one another by the step period is called the step signal. So, the step signal drives the stepper motor.
Many scanners have sensors that are physically configured to scan an image at 600 dots per inch (DPI) or an integer fraction thereof: 300, 200, 150, 120, 100, 85.71, and 75 DPI. (Other resolutions are generally made by scanning at the next higher resolution and then processing the line data in software to reduce it to the desired resolution.) Many scanners also prefer to scan at the same vertical resolution as horizontal resolution. In such a situation the scanner is set such that one step is {fraction (1/600)}th of an inch, and the scanner takes an integer number of steps per integration period.
FIG. 1 illustrates the movement of a sensor driven by a stepper motor that takes an integer number of steps per integration period. The x-axis shows time in processor clock periods, and the y-axis shows distance in lines. Line 32 shows the progress of the sensor as it moves over the lines. Integration signal 20 has a period equal to the time the scanner takes to process one line, so the pulses of integration signal 20 define the lines. Pulses of step signal 22 cause the sensor to move one step. The illustrated relationship between integration signal 20 and step signal 22 is such that the sensor moves one step per integration period, which for many scanners indicates the highest vertical and horizontal resolution of 600 DPI. Similarly, two pulses of step signal 22 per integration period would indicate that the sensor moves twice as far in one line, so each line would have a doubled vertical dimension and the scan would be at 300 DPI.
Region 28 is the area in which the sensor moves across lines of the image and detects the light levels thereof. In the middle of the sixth line, pause signal 24 goes high to indicate that the buffer is about to be full and the scanner should stop scanning. The scanner continues processing line six, although other scanners may be configured to stop processing immediately. If the scanner is scanning at more than one step per integration period then the stepper motor should continue stepping until the line has been completed, otherwise the partial data of the line may have to be discarded and the line re-scanned in its entirety upon resuming.
Upon de-assertion of the step signal 22 pulse, at the end of the sixth line, the data valid signal 26 goes low to indicate that the sensor has completed scanning line six, the last line to be scanned before the pause. Any light levels the sensor detects at this point should not be transferred into the buffer.
Ideally, the sensor would pause right at the start of line seven, because the pulses of step signal 22 could be paused at that point. However, the physical characteristics of the stepper motor and the sensor, such as the mass of the sensor and the finite torque of the stepper motor, result in nonideal conditions. These nonideal conditions may cause the sensor to continue moving into line seven, resulting in an inaccurate sensor position upon resuming. Similarly, nonidealities affect the resuming of sensor movement as well, causing the sensor to move with a nonuniform velocity when it is first restarted. This further increases distortion of the resulting scan.
Many scanners solve these problems by moving the sensor backward over previously-scanned lines during a pause. This solves the continued movement problem because the sensor can move backward enough to compensate for the continued forward movement. It solves the nonuniform velocity problem because the sensor can reach a constant velocity after accelerating over the previously-scanned lines.
As shown in FIG. 1, in region 30 the step signal 22 pulses three times after pause signal 24 goes low, moving the sensor backward three lines. Pulses of the integration signal 20 may continue, if desired, even though no valid data is being generated.
In region 34, no pulses of step signal 22 are generated as the scanner waits for the buffer to empty. Pulses of the integration signal 20 may continue, if desired. Near the end of region 34, the pause signal 24 changes to indicate that the buffer is no longer full and the scanner can resume moving and generating data.
In region 38, pulses of step signal 22 resume. These three pulses are to move the sensor forward again (over the reversed lines of region 30).
In region 40, after the three pulses of step signal 22 (in region 38), the data valid signal 26 goes high to indicate that the sensor is now at line seven, the correct line to resume generating data.
As detailed above, the scanner having the movement shown in FIG. 1 takes an integer number of steps (specifically, one step) per integration period. However, not all scanners take an integer number of steps per integration period, for example, as described in U.S. patent application Ser. No. 09/166,871 entitled xe2x80x9cApparatus, Method, and Computer Program for Increasing Scanner Data Throughputxe2x80x9d, assigned to the owner of the present application and incorporated herein by reference. A scanner that takes a non-integer number of steps per integration period will have resuming problems not solved by scanners such as those described above, as detailed in FIG. 2.
FIG. 2 illustrates the movement of a sensor driven by a stepper motor that takes a non-integer number of steps per integration period. The x-axis, y-axis, line 32, integration signal 20, pause signal 24, and data valid signal 26 are as described above regarding FIG. 1. Step signal 50 has a period slightly longer than that of integration signal 20; specifically, seven step pulses per eight integration pulses.
The first difference from FIG. 1 is that, in region 30, the sensor moves into line seven because the stepper motor does not generate reverse movement until the step pulse 52, which occurs after line six has been scanned.
The second difference from FIG. 1 is that region 34 is split into a new region 36 because of the non-integer relationship between integration signal 20 and step signal 50. In region 36, the step signal 50 must begin at a timing such that, when generation of valid data resumes in region 40 at integration pulse 54, the sensor is at the correct position to sense line seven. If the step signal 50 begins too soon, the sensor moves along line 56. When line 56 intersects with the timing of integration pulse 54, the sensor begins scanning too late and scans mostly line eight instead of line seven, effectively skipping line seven. If the step signal 50 begins too late, the sensor moves along line 58. When line 58 intersects with the timing of integration pulse 54, the sensor begins scanning too early and scans mostly line six instead of line seven, effectively duplicating line six. Such skipping and duplication can lead to a distorted scan. This distortion results whenever the timing of the resumption of the step signal varies from what it should be.
Thus, a way is needed to control resumption of generation of the step signal after a pause such that the effects of skipping and duplication can be reduced.
The present invention addresses these and other problems of existing scanners by providing an apparatus, method, and computer program for controlling a scanner to reduce distortion of a scanned image on a resume after a pause.
According to one embodiment, an apparatus according to the present invention has a circuit that reduces distortion by controlling a scanner configured to scan an image with a sensor by relative movement therebetween in units of steps. The circuit includes a phase difference storage circuit and a control circuit. The phase difference storage circuit is configured to store a phase difference value. The control circuit is coupled to the phase difference storage circuit and is configured to receive a pause signal, an integration signal, a processor clock signal, and the phase difference value, and in accordance therewith to generate a step control signal.
According to another embodiment, a method according to the present invention reduces distortion by controlling a scanner configured to scan an image with a sensor. The method includes the steps of monitoring an integration signal and a step signal, and calculating at least one phase difference value based on a phase difference between the integration signal and the step signal. The integration signal has an integration period in which a line of an image is scanned, and the step signal has a step period in which a step of relative movement between the image and the sensor is performed. The phase difference is a comparative characteristic between the step signal and the integration signal.
According to yet another embodiment, a computer program according to the present invention reduces distortion by controlling a scanner configured to scan an image with a sensor. The computer program includes a phase difference calculation subroutine configured to calculate a phase difference value based on a phase difference between an integration period in which a sensor scans a line of an image and a step period in which a step of relative movement between the image and the sensor is performed.